package com.express.emnus;

public enum OrderStatusEnum {

    YQS("1", "已签收"),
    WQS("2", "未签收"),
    PSZ("3", "派送中"),
    YSZ("4", "运送中"),
    QT("0", "其他");

    private String type;
    private String description;

    OrderStatusEnum(String type, String description) {
        this.type = type;
        this.description = description;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public static String getOrderStatus(String type) {
        for (OrderStatusEnum t : OrderStatusEnum.values()) {
            if (t.getType().equals(type)) {
                return t.getDescription();
            }
        }
        return "";
    }

    public static String getType(String description) {
        for (OrderStatusEnum t : OrderStatusEnum.values()) {
            if (t.getDescription().equals(description)) {
                return t.getType();
            }
        }
        return "";
    }

}